cmake_minimum_required(VERSION 3.10) # 设置CMake最低版本要求

project(IMG_STATIC_LIB VERSION 1.0 LANGUAGES C CXX) # 定义项目名称和版本号
set(VCPKG_INCLUDE_PATH "C:/Code/vcpkg-master/installed/x64-windows-static/include")
set(JPEG2K_INCLUDE_PATH "C:/Code/jpeg2k_wrap/openjpeg-master/src/lib/openjp2;C:/Code/jpeg2k_wrap/openjpeg-master/src/lib/openjpip;C:/Code/jpeg2k_wrap/openjpeg-master/build/src/lib/openjp2")
set(LIB_PATH "C:/Code/vcpkg-master/installed/x64-windows-static/lib")
set(JPEG2K_LIB_PATH "C:/Code/jpeg2k_wrap/openjpeg-master/build/bin/Debug")

# 指定输出目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

# 设置C++标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 添加头文件搜索路径
include_directories(${VCPKG_INCLUDE_PATH} ${JPEG2K_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../src)

# 收集所有源文件
file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
# file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp" )
add_definitions(-DOPJ_STATIC)
# 添加可执行文件
add_executable(img_wrap_test ${SOURCES})
# 链接静态库
target_link_libraries(img_wrap_test PRIVATE  ${LIB_PATH}/jpeg.lib  ${LIB_PATH}/turbojpeg.lib    ${JPEG2K_LIB_PATH}/openjp2.lib   "C:/Code/jpeg2k_wrap/build/lib/Debug/IMG_WRAP.lib")


